<?php include_once 'Pecahan/sessionLontong.php'; ?>

<?php
include_once 'controller/login.php';
if(isset ($_POST['search_user_button'])) {
    $user = new login();
    $result = $user->showProfileByUserName($_POST['search_user']);
}
?>
<?php $judul = 'Cari User'; ?>
<?php include_once 'Pecahan/header.php'; ?>
<table class="tabel">
    <tr>
        <th>
            <div>
                <form class="search" action="searchuser.php" method="post">
                    <label>User Name:</label>
                    <input type="text" name="search_user" id="search_user"/>
                    <input type="submit" value="Search User" id="search_user_button" name="search_user_button"/>
                </form>
            </div>
        </th>
        <th>
            <div>
                <form class="search" action="searchphoto.php" method="post">
                    <label>Photo:</label>
                    <input type="text" name="search_photo" id="search_photo"/>
                    <input type="submit" value="Search Photo" id="search_photo_button" name="search_photo_button"/>
                </form>
            </div>
        </th>
    </tr>
</table>

<div class="isipage">
    <div class="isipagestandar">
        <div>

        </div>
        <div class="space">

        </div>
        <div>
            <?php
            $iterate=0;
            while($row = mysql_fetch_array($result)) {
                ?>
            <div class="floatleft" id="photogallery">
                    <?php
                    $iterate++;
                    $urlProfile = "profil.php?name_viewed=" . $row['user_name'];
                    ?>
                <a href="<?php echo $urlProfile ?>" >
                    <img id="<?php echo "foto_" . $iterate?>" name="<?php echo "foto_" . $iterate?>" src="<?php echo $row['url_photo'] ?>" alt="<?php echo "foto_" . $iterate?>" width="100" height="100" border="0"/>
                </a>
                <div>
                    <label><?php echo $row['user_name'] ?></label>
                </div>
            </div>
                <?php } ?>
        </div>
    </div>
</div>
<?php include_once 'Chat/chat.php';?>
<?php include_once 'Pecahan/footer.php'; ?>
